package com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.factoryModel.factory;

import com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.factoryModel.inter.Shape;
import com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.factoryModel.shapeSubclass.shapeTest_01;
import com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.factoryModel.shapeSubclass.shapeTest_02;
import com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.factoryModel.shapeSubclass.shapeTest_03;

/**
 * 杭州惟君医疗科技有限公司17
 * Created by 20433 on 2018/5/16
 *
 * @desc 东风山河绿，春已不折柳，繁花看不尽，处处惹人留
 * @desc 佛祖镇楼，bug辟容易
 */

public class ShapeFactory {
    public Shape getShape(String ShapeType){
        if(ShapeType == null){
            return null;
        }

        switch (ShapeType){
            case "CIRCLE":
                return new shapeTest_01();
            case "RECTANGLE":
              return new shapeTest_02();
            case "SQUARE":
                return new shapeTest_03();
        }
        return null;
    }
}
